<?php
/*********************************************************************************************
										>>VERSION PARA MySQL SERVER<<
 *********************************************************************************************/
//
class DataBase{

	var $serverName;
	var $port;	
	var $username; // username 
	var $password; // password 
	var $db_name; // Database name 
	var $connectionInfo;
	var $link;

	// constructor
	function DataBase($serverName, $port, $db_name, $username, $password){
		$this->serverName = $serverName . "," . $port;
		$this->port = $port;
		$this->db_name = $db_name;
		$this->username = $username;
		$this->password = $password;
		$this->connectionInfo = array("UID"=>$this->username, "PWD"=>$this->password, "Database"=>$this->db_name);
		// echo $this->serverName . "," . $this->username . "," . $this->password . "," . $this->db_name;
		$conexion = mysql_connect($serverName, $username, $password);
		
		if (!$conexion) { 
			die('<strong>No pudo conectarse:</strong> ' . mysql_error()); 
		}else{ 
	
		}
		mysql_select_db($db_name, $conexion) or die(mysql_error($conexion));  
		$this->link = $conexion;
		//$this->link = mysqli_connect($this->serverName . "," . $this->username . "," . $this->password . "," . $this->db_name) or die("No se puede conectar a la base de datos" . $db_name . " En el Servidor: " . $serverName);
		}

	}
	?>